package Tween
{
	import Plugin.TweenObjectPlugin;
	import Plugin.TweenPlugin;
	
	import Tools.MathTool;

	public class ColorTween extends TweenObjectPlugin
	{
		public var strength:Number=1;
		public var color:uint=0;
		public function ColorTween()
		{
			super();
		}
		override protected function _update():void
		{
			if(time==0)return;
			
			var colors:Array=MathTool.splitColor(color);
			
			var red:int=easeing(time,0,colors[0]-0,duration);
			
			var green:int=easeing(time,0,colors[1]-0,duration);
			
			var blue:int=easeing(time,0,colors[2]-0,duration);
			
			var newColor:uint=MathTool.mergerColor(red,green,blue);
			
			go.tint(newColor,strength);
		}
	}
}